﻿<?xml version="1.0" encoding="utf-8" ?>
<hibernate-mapping xmlns="urn:nhibernate-mapping-2.2">
  <class name="MCromwell.StaffIntranet.Core.Staff, MCromwell.StaffIntranet.Core" table="Staff">
    <id name="Id" column="Id" type="Int32" unsaved-value="-1">
      <generator class="native" />
    </id>

    <property name="LastName" column="LastName" type="String" length="255"/>
    <property name="FirstName" column="FirstName" type="String" length="255"/>
    <property name="MiddleName" column="MiddleName" type="String" length="255"/>
    <property name="EmailAddress" column="EmailAddress" type="String" length="512"/>
    <property name="TelephoneNumber" column="TelephoneNumber" type="String" length="50"/>
    <property name="Extension" column="Extension" type="String" length="32"/>
    <property name="Photo" column="Photo" type="BinaryBlob"/>
    <many-to-one name="Location" column="LocationId" class="MCromwell.StaffIntranet.Core.Location, MCromwell.StaffIntranet.Core" />
  </class>
  <sql-query name="StaffSearchingWithPaging">
    <return class="MCromwell.StaffIntranet.Core.Staff, MCromwell.StaffIntranet.Core">
      <return-property name="Id" column="Id"/>
      <return-property name="LastName" column="LastName"/>
      <return-property name="FirstName" column="FirstName"/>
      <return-property name="MiddleName" column="MiddleName"/>
      <return-property name="EmailAddress" column="EmailAddress"/>
      <return-property name="TelephoneNumber" column="TelephoneNumber"/>
      <return-property name="Extension" column="Extension"/>
      <return-property name="Location" column="LocationId"/>
      <return-property name="Photo" column="Photo"/>  
    </return>
    exec SearchStaffWithPaging :StartRowIndex, :MaximumRows, :LastName, :FirstName, :LocationId
  </sql-query>
  <sql-query name="SearchStaffPagingCount">
     <return-scalar type="Int32" column="VirtualCount"/>
    exec SearchStaffPagingCount :LastName, :FirstName, :LocationId
  </sql-query>
</hibernate-mapping>